//////////////////////////////////////////////////////////////////////////

#ifndef _GUI_H_
#define _GUI_H_

//#include <SDL\SDL_ttf.h>
//#include <SDL\SDL.h>
//#include <SDL\SDL_main.h>
#include <vector>

//#ifndef _SCREEN_H_
//#include "screen.h"
//#endif

#ifndef _INPUT_H_
#include "input.h"
#endif

#include <string>

class Client;
class ServerStatePacket;
class GUI_Screen;
struct SDL_Surface;
struct SDL_Rect;
struct PlayersInfo;

class GUI
{
//////////////////////////////////////////////////////////////////////////

public:

//////////////////////////////////////////////////////////////////////////

    GUI();
    ~GUI();

    enum Screen {Splash, Menu, Play, Exit, ScreenCount};

    void Resize(int _mode, bool _fullscreen);
    void RunGameLoop();
    int GetCurrentScreenMode();
    bool GetCurrentFullscreenMode();
    SDL_Rect *GetResolution(int _mode);

    Client *GetClient();
    void SwitchToScreen(GUI::Screen _screen);

    /** Start client GUI */
    void Start( Client* _client );


    /** Set client ID */
    void SetID( int _ID );

    void UpdateServerStatistics( const PlayersInfo& _playersInfo );

    /** Set client ID */
    void AddStateToRenderQueue( const ServerStatePacket& _packet );

    /** Create battlefield map */
    void CreateMap( const std::string& _mapName );
//////////////////////////////////////////////////////////////////////////

private:

//////////////////////////////////////////////////////////////////////////

//    GUI_Theme *m_Theme;
    SDL_Rect** m_ScreenModes;
    int m_CurrentScreenMode;
    bool m_CurrentFullscreenMode;
    int m_ScreenModeCount;
    float m_ResizeFactor;

    bool m_NeedSwitchingScreen;
    void DoSwitchingScreen();

    SDL_Surface *m_Surface;

    GUI::Screen m_CurrentScreen;
    GUI::Screen m_PreviousScreen;
    //GUI_Screen m_ScreensArr [ScreenCount];
    std::vector<GUI_Screen *> m_Screens;

    void Render();


    /** Process input events */
    void ProcessInput();


    /** Client ID */
    int m_ID;


    /** Input */
    Input m_Input;


    /** Client interface */
    Client* m_Client;


//////////////////////////////////////////////////////////////////////////
};


//////////////////////////////////////////////////////////////////////////

#endif

//////////////////////////////////////////////////////////////////////////
